<template>
	<view style="padding:0 15px;">
    <view style="height: 50px;line-height: 50px;text-align: center;" v-show="note_timelist.length!=0">
      当前客户：{{this.note_timelist[0]&&this.note_timelist[0].user_name}}
    </view>
    <view style="height: 50px;line-height: 50px;text-align: center;" v-show="note_timelist.length==0">
      暂无当前客户跟进信息
    </view>
		<timelineItem v-for="item in this.note_timelist" :key="item.id" :leftTime="item.time" color='rgb(0, 79, 191)'>
        <view class="tripItem">
          <view class="title" v-html="item.content"></view>
            <view class="tips" style="text-align: right;">{{status(item.status)}}</view>
        </view>
    </timelineItem>
	</view>
</template>

<script>
  import timeline from '../../components/chenbin-timeline/timeLine.vue'
  import timelineItem from '../../components/chenbin-timeline/timelineItem.vue'
	export default {
    components:{
      timeline,
      timelineItem
    },
		data() {
			return {
				note_timelist:[]
			};
		},
    methods:{
      status(val){
        if(val == 0){
          return "跟进中"
        }else if(val == 1){
          return "已完成"
        }else if(val == 2){
          return "驳回"
        }else{
          return val
        }
      }
    },
    onLoad(e){
      uni.request({
        url:`${this.$http}/api/merchant/note_time`,
        method:"POST",
        data:{
          id:e.id
        },
        success: (res) => {
          console.log('跟进信息',res.data)
          if(res.data.code==200){
            this.note_timelist = res.data.data
          }
        }
      })
    }
	}
</script>

<style lang="scss">
.tripItem {
    padding: 20rpx 30rpx;
    box-sizing: border-box;
    background:rgba(255,255,255,1);
    box-shadow:0px 0px 20px 0px rgba(0,0,0,0.08);
    border-radius:10px;
    margin-bottom: 30rpx;
    .title {
        font-size:28rpx;
        font-family:PingFangSC-Medium,PingFang SC;
        font-weight:500;
        color:rgba(51,51,51,1);
    }
    .tips {
        font-size:22rpx;
        font-family:PingFangSC-Regular,PingFang SC;
        font-weight:400;
        color:rgba(153,153,153,1);
        margin-top: 20rpx;

    }
}
</style>
